<script setup>
import { ref, onMounted } from 'vue'
import { useI18n } from 'vue-i18n'
import { useRouter } from 'vue-router'
import PaymentGuide from './PaymentGuide.vue'

const { t } = useI18n()
const router = useRouter()

const navigateTo = (path) => {
  router.push(path)
}

onMounted(() => {
  setTimeout(() => {
    document.querySelector('.hero-text').classList.add('animated')
    document.querySelector('.search-container').classList.add('animated')
  }, 300)
})
</script>

<template>
  <section class="hero-section">
    <div class="hero-content">
      <div class="hero-text">
        <div class="year-tag">{{ t('hero.year') }}</div>
        <h1 class="main-title">
          <span class="title-line">{{ t('hero.titleLine1') }}</span>
          <span class="title-line">{{ t('hero.titleLine2') }}</span>
          <span class="title-line">{{ t('hero.titleLine3') }}</span>
        </h1>
        <p class="subtitle">{{ t('hero.subtitle') }}</p>
      </div>
    </div>

    <!-- 搜索/选项卡区域 -->
    <div class="search-container">
      <div class="search-tabs">
        <div class="tab" @click="navigateTo('/visa')">
          <div class="tab-icon">
            <i class="fas fa-passport"></i>
          </div>
          <div class="tab-content">
            <div class="tab-title">签证政策</div>
            <div class="tab-subtitle">免签入境中国</div>
          </div>
        </div>
        <div class="tab" @click="navigateTo('/payment')">
          <div class="tab-icon">
            <i class="fas fa-wallet"></i>
          </div>
          <div class="tab-content">
            <div class="tab-title">支付指南</div>
            <div class="tab-subtitle">轻松支付无障碍</div>
          </div>
        </div>
        <div class="tab" @click="navigateTo('/travel')">
          <div class="tab-icon">
            <i class="fas fa-route"></i>
          </div>
          <div class="tab-content">
            <div class="tab-title">智能行程</div>
            <div class="tab-subtitle">AI规划旅游路线</div>
          </div>
        </div>
        <div class="tab" @click="navigateTo('/forum')">
          <div class="tab-icon">
            <i class="fas fa-comments"></i>
          </div>
          <div class="tab-content">
            <div class="tab-title">旅行论坛</div>
            <div class="tab-subtitle">分享旅行经验</div>
          </div>
        </div>

      </div>
    </div>
  </section>
</template>

<style scoped>
/* 主横幅区域样式 */
.hero-section {
  width: 100%;
  min-height: calc(100vh - 70px);
  position: relative;
  background-image: url('@/assets/home/bg3.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1;
}

.hero-content {
  max-width: 1600px;
  margin: 0 auto;
  padding: 60px 20px;
  display: flex;
  position: relative;
  z-index: 2;
}

.hero-text {
  width: 55%;
  padding-top: 40px;
  margin-left: 100px;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease;
}

.hero-text.animated {
  opacity: 1;
  transform: translateY(0);
}

.year-tag {
  color: #ffffff;
  font-size: 1.5rem;
  margin-bottom: 20px;
  font-weight: 500;
}

.main-title {
  font-size: 3.5rem;
  font-weight: bold;
  line-height: 1.3;
  margin-bottom: 20px;
  color: #ffffff;
}

.title-line {
  display: block;
}

.subtitle {
  font-size: 1.2rem;
  color: #ffffff;
  margin-bottom: 50px;
}

/* 搜索/选项卡区域样式 */
.search-container {
  max-width: 840px;
  margin-left: 100px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 10;
  overflow: hidden;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease 0.2s;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.search-container.animated {
  opacity: 1;
  transform: translateY(0);
}

.search-tabs {
  display: flex;
  width: 100%;
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 25px 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #ffffff;
  position: relative;
  overflow: hidden;
}

.tab::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 3px;
  background-color: #16a34a;
  transition: width 0.3s ease;
}

.tab:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.tab:hover::before {
  width: 60%;
}

.tab-icon {
  font-size: 28px;
  margin-bottom: 12px;
  color: #ffffff;
  transition: transform 0.3s ease;
}

.tab:hover .tab-icon {
  transform: translateY(-5px);
}

.tab-content {
  text-align: center;
}

.tab-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 5px;
  color: #ffffff;
}

.tab-subtitle {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
}

/* 响应式样式 */
@media (max-width: 1200px) {
  .hero-text {
    margin-left: 80px;
  }
  .search-container {
    margin-left: 80px;
  }
  .main-title {
    font-size: 3rem;
  }
}

@media (max-width: 992px) {
  .hero-content {
    flex-direction: column;
  }
  .hero-text {
    margin-left: 60px;
    width: 100%;
    padding-top: 20px;
  }
  .search-container {
    margin-left: 60px;
    max-width: 90%;
  }
  .main-title {
    font-size: 2.5rem;
  }
}

@media (max-width: 768px) {
  .hero-text {
    margin-left: 40px;
  }
  .search-container {
    margin-left: 40px;
  }
  .main-title {
    font-size: 2rem;
  }
  .tab {
    padding: 20px 10px;
  }
  .tab-icon {
    font-size: 24px;
    margin-bottom: 8px;
  }
  .tab-title {
    font-size: 0.9rem;
  }
  .tab-subtitle {
    font-size: 0.75rem;
  }
  .search-tabs {
    flex-wrap: wrap;
  }
  .tab {
    flex: 0 0 50%;
  }
}

@media (max-width: 576px) {
  .hero-text {
    margin-left: 20px;
  }
  .search-container {
    margin-left: 20px;
  }
  .main-title {
    font-size: 1.8rem;
  }
  .subtitle {
    font-size: 1rem;
  }
}
</style> 